home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / svgabg31.zip / VGAPALET.C < prev   
Text File  |  1991-11-16  |  2KB  |  91 lines

  1. /************************************************/
  2. /*                         */
  3. /*          SuperVGA BGI driver defines        */
  4. /*        Copyright (c) 1991        */
  5. /*        Jordan Hargraphix Software        */
  6. /*                        */
  7. /************************************************/
  8.  
  9. #include <dos.h>
  10. #include "svga16.h"
  11. #include "svga256.h"
  12. #include "twk16.h"
  13. #include "twk256.h"
  14. #include "svga32k.h"
  15.  
  16. /* Getvgapalette16 gets the entire 16 color palette */
  17. /* PalBuf contains RGB values for all 16 colors     */
  18. /* R,G,B values range from 0 to 63                */
  19. /* Usage:                         */ 
  20. /*  DacPalette16 dac16;                             */
  21. /*                            */
  22. /*  getvgapalette(&dac16);                */
  23. void getvgapalette16(DacPalette16 *PalBuf)
  24. {
  25.   struct REGPACK reg;
  26.  
  27.   reg.r_ax = 0x1017;
  28.   reg.r_bx = 0;
  29.   reg.r_cx = 16;
  30.   reg.r_es = FP_SEG(PalBuf);
  31.   reg.r_dx = FP_OFF(PalBuf);
  32.   intr(0x10,®);
  33. }
  34.  
  35. /* Getvgapalette256 gets the entire 256 color palette */
  36. /* PalBuf contains RGB values for all 256 colors      */
  37. /* R,G,B values range from 0 to 63                  */
  38. /* Usage:                          */
  39. /*  DacPalette256 dac256;                  */
  40. /*                              */
  41. /* getvgapalette256(&dac256);                  */
  42. void getvgapalette256(DacPalette256 *PalBuf)
  43. {
  44.   struct REGPACK reg;
  45.  
  46.   reg.r_ax = 0x1017;
  47.   reg.r_bx = 0;
  48.   reg.r_cx = 256;
  49.   reg.r_es = FP_SEG(PalBuf);
  50.   reg.r_dx = FP_OFF(PalBuf);
  51.   intr(0x10,®);
  52. }
  53.  
  54. /* Setvgapalette16 sets the entire 16 color palette */
  55. /* PalBuf contains RGB values for all 16 colors     */
  56. /* R,G,B values range from 0 to 63                */
  57. /* Usage:                         */ 
  58. /*  DacPalette16 dac16;                             */
  59. /*                            */
  60. /*  setvgapalette(&dac16);                */
  61. void setvgapalette16(DacPalette16 *PalBuf)
  62. {
  63.   struct REGPACK reg;
  64.  
  65.   reg.r_ax = 0x1012;
  66.   reg.r_bx = 0;
  67.   reg.r_cx = 16;
  68.   reg.r_es = FP_SEG(PalBuf);
  69.   reg.r_dx = FP_OFF(PalBuf);
  70.   intr(0x10,®);
  71. }
  72.  
  73. /* Setvgapalette256 sets the entire 256 color palette */
  74. /* PalBuf contains RGB values for all 256 colors      */
  75. /* R,G,B values range from 0 to 63                  */
  76. /* Usage:                          */
  77. /*  DacPalette256 dac256;                  */
  78. /*                              */
  79. /* setvgapalette256(&dac256);                  */
  80. void setvgapalette256(DacPalette256 *PalBuf)
  81. {
  82.   struct REGPACK reg;
  83.  
  84.   reg.r_ax = 0x1012;
  85.   reg.r_bx = 0;
  86.   reg.r_cx = 256;
  87.   reg.r_es = FP_SEG(PalBuf);
  88.   reg.r_dx = FP_OFF(PalBuf);
  89.   intr(0x10,®);
  90. }
  91.